<?php
	namespace core;
	class BaseAction{
		protected $get;
		protected $post;
		protected $session;
		protected $cookie;
	
		//构造函数
		function __construct() {
           $this->get = App::get();
           $this->post = App::post();
           $this->session = App::session();
		   $this->cookie = App::cookie();
        }
		
		function redirect($url){
			if(!Util::startWith($url,'http')){
				header("location:".CONTEXT_PATH.$url);
			}else{
				header("location:".$url);
			}
		}
	
		protected function form($name=null){
			return App::form($name);
		}
		
		protected function view($name,$paramArr=null){
			return new View($name,$paramArr);
		}
		
		protected function json($jsonObject){
			print_r(json_encode($jsonObject));
		}
	}